<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/1/27
 * Time: 14:44
 */

namespace app\api\validate;
use think\Validate;

/**
 *  验证器
*/
class Server extends Validate
{
    protected $rule = [
        'server'    => 'require',
        'port'      => 'require|number|between:1000,65535',
        'key'       => 'require'
    ];

    protected $message = [
        'server.require'    => '服务器IP不能为空',
        'port.require'      => '端口号不能为空',
        //'server.regex'  => '服务端IP地址格式错误',
        'port.number'   => '端口号仅为数字',
        'port.between'  => '建议端口范围1000 - 65535',
        'key.require'   => '密钥不能为空',
    ];
}